/*
 * This file is a part of qloudgen-esb. 
 * You can redistribute qloudgen-esb and/or modify it under the terms of the Lesser GNU General Public License version 3. 
 * qloudgen-esb is distributed WITHOUT ANY WARRANTY. 
 * 
 * See the Lesser GNU General Public License for more details at http://www.gnu.org/licenses/.
 *  
 * Copyright (C) 2014 Qloudgen Technology
*/

package com.qloudgen.csb.client;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class Connection { 
	
	List<Session> sessions = new ArrayList<Session>();
	String clientID = UUID.randomUUID().toString().replace("-", "");
	
	public Connection() {
	}

	public void setClientID(String clientID) {
		this.clientID = clientID;
	}
	
	public String getClientID() {
		return clientID;
	}
	
	public void start() {
		for (int i = 0; i < sessions.size(); i++) {
			sessions.get(i).run();
		}
	}

	public void stop() {		
	}

	public void close() {		
	}

	public Session createSession() {
		Session session = new Session();
		sessions.add(session);
		
		return session;
	}
}

